package request

// 新建零售地
type CreateRetailArea struct {
	Name       string `form:"name" json:"name" binding:"required"`
	RetailName string `form:"retail_name" json:"retail_name" binding:"required"`
	Number     string `form:"number" json:"number"  binding:"required"`
}

// 自定义错误信息
func (c CreateRetailArea) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"name.required":        "水源名称不能为空",
		"retail_name.required": "采购地名称不能为空",
		"number.required":      "编号数值不能为空",
	}
}

type DeleteRetailArea struct {
	ID string `form:"id" json:"id" binding:"required"`
}

func (del DeleteRetailArea) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"id.required": "id不能为空",
	}
}

type EditorRetailArea struct {
	ID         string `form:"id" json:"id" binding:"required"`
	Name       string `form:"name" json:"name" binding:"required"`
	RetailName string `form:"retail_name" json:"retail_name" binding:"required"`
	Number     string `form:"number" json:"number"  binding:"required"`
}

func (editor EditorRetailArea) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"id.required":          "id不能为空",
		"name.required":        "水源名称不能为空",
		"retail_name.required": "采购地名称不能为空",
		"number.required":      "编号数值不能为空",
	}
}

// 新建发源地
type CreateWaterSourceArea struct {
	Name       string `form:"name" json:"name" binding:"required"`
	SourceName string `form:"source_name" json:"source_name" binding:"required"`
	Number     string `form:"number" json:"number"  binding:"required"`
}

// 自定义错误信息
func (c CreateWaterSourceArea) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"name.required":        "水源名称不能为空",
		"source_name.required": "发源地名称不能为空",
		"number.required":      "编号数值不能为空",
	}
}

// 删除水源发源地
type DeleteWaterSourceArea struct {
	ID string `form:"id" json:"id" binding:"required"`
}

func (del DeleteWaterSourceArea) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"id.required": "id不能为空",
	}
}

// 修改水源发源地
type EditorWaterSourceArea struct {
	ID         string `form:"id" json:"id" binding:"required"`
	Name       string `form:"name" json:"name" binding:"required"`
	SourceName string `form:"source_name" json:"source_name" binding:"required"`
	Number     string `form:"number" json:"number"  binding:"required"`
}

func (editor EditorWaterSourceArea) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"id.required":          "id不能为空",
		"name.required":        "水源名称不能为空",
		"source_name.required": "发源地名称不能为空",
		"number.required":      "编号数值不能为空",
	}
}
